﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="mtActivityType.aspx.vb" Inherits="mtActivityType" %>

<%@ Register Assembly="ISNet.WebUI.WebInput" Namespace="ISNet.WebUI.WebControls" TagPrefix="ISWebInput" %>

<%@ Register Assembly="ISNet.WebUI.WebTreeView" Namespace="ISNet.WebUI.WebTreeView" TagPrefix="ISWebTreeView" %>

<%@ Register Assembly="ISNet.WebUI.WebGrid" Namespace="ISNet.WebUI.WebGrid" TagPrefix="ISWebGrid" %>

<%@ Register Assembly="ISNet.WebUI.WebCombo" Namespace="ISNet.WebUI.WebCombo" TagPrefix="ISWebCombo" %>

<%@ Register Assembly="ISNet.WebUI.WebDesktop" Namespace="ISNet.WebUI.WebDesktop" TagPrefix="ISWebDesktop" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <link href="js/magicsuggest-1.2.6.css" rel="stylesheet" />
    <script src="js/magicsuggest-1.2.6.js"></script>
    <script src="script/packed.js"></script>
    <script src="script/tinybox.js"></script>
    <link href="script/style.css" rel="stylesheet" />
    <script type="text/javascript" src="js/JSON.js"></script>
    <script type="text/javascript">
        function closeJS() { doupdate() }
        function doupdate() {
            var grid = ISGetObject("WebGrid1");
            grid.ClearSelectedObject();
            grid.RootTable.UpdateUI();
            grid.RefreshAll();
        }
        function OnRowSelect(controlId, tblName, rowIndex, rowElm) {
            //var grid = ISGetObject("WebGrid1");
            //var ar = grid.GetSelectedObject().GetRowElement();
            //if (ar.IsAddNewRow) {
            //}
            //else {
            //    var row = grid.GetSelectedObject().GetRowObject();

            //    var combo = ISGetObject("AssetGroupWebCombo11");
            //    var Val2 = row.GetCells().GetNamedItem("AssetGroup").Value
            //    combo.SetValue(Val2);

            //    var combo2 = ISGetObject("Commitment2WebCombo");
            //    var Val3 = row.GetCells().GetNamedItem("CmmtCode").Value
            //    combo2.SetValue(Val3);

            //    //var ar = grid.GetSelectedObject().GetRowElement();
            //}
        }
        function WebGrid1_OnRowContextMenu(controlId, rowType, rowElement, menuObject) {
            menuObject.Items[0].Hide();

            return false;
        }
        function WebGrid1_OnRowValidate(rowObject) {
            // retrieves WebGrid's object
            var grid = ISGetObject("WebGrid1");

            // access WebGrid's RootTable
            var rootTable = grid.RootTable;

            var row = rootTable.ToRowObject(rowObject); // convert the rowObject (HTMLElement) to WebGridRow object
            var htmlRow = row.GetElement();
            var cells = row.GetCells(); // get collection of WebGridCell
            var error = 0;
            var err_text = "กรุณาตรวจสอบ \n"

            //alert("1");
            var data
            data = wgGetCellByPosition(htmlRow, 1).innerText;
            if (data.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g, '').replace(/\s+/g, ' ') == "") {
                err_text = err_text + "\n   ● ID                          ";
                error = error + 1;
            }
            data = wgGetCellByPosition(htmlRow, 2).innerText;
            if (data.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g, '').replace(/\s+/g, ' ') == "") {
                err_text = err_text + "\n   ● Plan Year                                 ";
                error = error + 1;
            }
            data = wgGetCellByPosition(htmlRow, 3).innerText;
            if (data.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g, '').replace(/\s+/g, ' ') == "") {
                err_text = err_text + "\n   ● Description                             ";
                error = error + 1;
            }
            data = wgGetCellByPosition(htmlRow, 4).innerText;
            if (data.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g, '').replace(/\s+/g, ' ') == "") {
                err_text = err_text + "\n   ● Price                             ";
                error = error + 1;
            }
            data = wgGetCellByPosition(htmlRow, 5).innerText;
            if (data.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g, '').replace(/\s+/g, ' ') == "") {
                err_text = err_text + "\n   ● Asset Group                             ";
                error = error + 1;
            }
            data = wgGetCellByPosition(htmlRow, 6).innerText;
            if (data.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g, '').replace(/\s+/g, ' ') == "") {
                err_text = err_text + "\n   ● Commitment Item                             ";
                error = error + 1;
            }


            //alert("2");
            if (error == 0) {
                return true;
            } else {
                alert(err_text);
                return false;
            }

        }

        function WebGrid1_OnEditKeyDown(controlId) {
            //alert(event.keyCode);
            var grid = ISGetObject("WebGrid1");

            var totalRows = grid.TotalRows;
            var totalCells = grid.TotalCells;
            var curRow = grid.GetSelectedObject().rowIndex;
            var curCell = grid.GetActiveEditCell().cellIndex;
            
            // if enter key
            if (event.keyCode == 13) {
                if (totalRows >= 2) {
                    if (curRow < totalRows - 1) {
                        keyDown(curRow, curRow + 1, curCell - 1);
                    }
                }
                //grid.ExitEdit(1,0,0);
                //return false;
                //var ar = grid.GetSelectedObject().GetRowElement();

                //if (ar.IsAddNewRow) {
                //    ar.commit();
                //}
                //else {
                //    event.keyCode = 40;
                //    keyDown(curRow, curRow + 1, curCell - 1);
                //}
            }

                // if up arrow
            else if (event.keyCode == 38 && grid.GetSelectedObject().GetRowObject().Type != "NewRow") {
                if (totalRows >= 2) {
                    if (curRow > 0) {
                        keyDown(curRow, curRow - 1, curCell - 1);
                    }
                }
            }

                // if down arrow key
            else if (event.keyCode == 40 && grid.GetSelectedObject().GetRowObject().Type != "NewRow") {
                if (totalRows >= 2) {
                    if (curRow < totalRows - 1) {
                        keyDown(curRow, curRow + 1, curCell - 1);
                    }
                }
            }
                // if left arrow key
            else if (event.keyCode == 37) {

                if (curCell > 1) {
                    //jq(document).trigger(jq.Event('keydown', { keyCode: 9, shiftKey: true }));
                    //var press = jQuery.Event("keydown");
                    //press.shiftKey = false;
                    //press.which = 9;
                    //jq("WebGrid1").trigger(press);
                    //alert("x");
                    //return;
                    keyDown2(curRow, curCell - 2);

                }
            }
                // if right arrow key
            else if (event.keyCode == 39) {
                //if (curCell < totalCells - 1) {
                event.keyCode = 9;
                return true;
                //}
            }


        }

        function keyDown(curRow, nextRow, cell) {
            var grid = ISGetObject("WebGrid1");
            var nextRowEl = grid.RootTable.GetRow(nextRow);
            var curRowEl = grid.RootTable.GetRow(curRow);
            var cell1 = nextRowEl.GetCell(cell);
            var cell2 = curRowEl.GetCell(cell);
            grid.ExitEdit(1, 0, 0);
            grid.SetFocus();

            cell2.Select(true);
            
            nextRowEl.Select();
            
            cell1.ActivateEdit();
        }
        function keyDown2(curRow, cell) {
            var grid = ISGetObject("WebGrid1");

            var selectedObject = grid.GetSelectedObject(); // return object of type SelectedObject
            var selectedRow = selectedObject.ToRowObject();
            var cell1 = selectedRow.GetCell(cell);
            grid.SetFocus();
            
            cell1.Select(true);
            cell1.ActivateEdit();
            
        }

        function triggerKeyEvents(field, keyCode, shiftKey, ctrlKey) {

            field = $(field);

            shiftKey = Boolean(shiftKey);

            ctrlKey = Boolean(ctrlKey);


            field.simulate("keydown", {
                keyCode: keyCode,

                ctrlKey: ctrlKey,

                shiftKey: shiftKey
            });

            field.simulate("keypress", {
                keyCode: keyCode,

                ctrlKey: ctrlKey,

                shiftKey: shiftKey
            });


            if (field.is(HTML5_TEXT_INPUT_FIELD_SELECTOR)) {

                applyKeyCodeToValue(field, keyCode);

            }


            field.simulate("keyup", {
                keyCode: keyCode,

                ctrlKey: ctrlKey,

                shiftKey: shiftKey
            });

        }

        function SaveScrollPosition(gridId, action) {
            // collecting the last position
            // of the vertical scrollbar
            // by obtaining the scrollTop property
            var grid = ISGetObject(gridId);
            // obtain the scrollTop and scrollLeft property 
            // of the vertical scrollbar and horizontal scrollbar
            var vl = grid.RootTable.GetElement(WG40.BODY, WG40.HTMLDIV).scrollTop + "";
            var hl = grid.RootTable.GetElement(WG40.BODY, WG40.HTMLDIV).scrollLeft + "";
            // only send the scrollTop property
            // of the server if the action performed
            // by the grid OTFPB is 'Refresh'

            //if (action == "Refresh") {
            // sending over the scrollTop and scrollLeft property
            // to the server by using AddInput method
            grid.AddInput("scrollTopPos", vl);
            grid.AddInput("scrollLeftPos", hl);
            //}

            return true;
        }
        function ApplyLatestScroll(gridId, y, x) {
            // set back the previous scrollTop and scrollLeft property or
            // vertical and horizontal scroll position with 
            // the parameter sent from the server side
            var grid = ISGetObject(gridId);
            // manually configure the vertical and horizontal scroll position
            grid.RootTable.GetElement(WG40.BODY, WG40.HTMLDIV).scrollTop = y;
            grid.RootTable.GetElement(WG40.BODY, WG40.HTMLDIV).scrollLeft = x;

            var cellEl = grid.GetActiveEditCell().ToCellObject();
            grid.SetFocus();
            cellEl.ActivateEdit();
            return true;
        }


        function CustomRequestDel(del, code, year) {

            if (confirm('กรุณายืนยันการลบข้อมูล') == false) {
                return false
            }
            var grid = ISGetObject("WebGrid1");


            grid.AddInput("id", del);
            grid.AddInput("code", code);
            grid.AddInput("year", year)
            grid.AddInput("type", "1");
            grid.SendCustomRequest();

            event.cancelBubble = true;
            event.returnValue = false;
        }
        function CustomRequestChkDel() {
            if (confirm('กรุณายืนยันการลบข้อมูล') == false) {
                return false
            }
            var grid = ISGetObject("WebGrid1");
            var table = grid.GetRootTable();
            var checkedRows = table.GetCheckedRows();

            if (checkedRows.length == 0) {
                alert("Please check an item.");
                setTimeout(function () { grid.SetFocus(); }, 10);
            }
            else {

                grid.AddInput("type", "2");
                //alert("gfgfgfg");
                grid.SendCustomRequest();

            }

            event.cancelBubble = true;
            event.returnValue = false;
        }
        function popupattach1(Id, ActivityTypeCode, PlanYear) {
            var grid = ISGetObject("WebGrid1");
            var row = grid.GetSelectedObject().GetRowObject();
            var key = row.KeyValue;
            TINY.box.show({ iframe: 'ActivityTypeUpload.aspx?ID=' + ActivityTypeCode + '&Type=Activity&PlanYear=' + PlanYear, boxid: 'frameless', width: 540, height: 450, fixed: false, maskid: 'lightmask', maskopacity: 40, closejs: function () { closeJS() } });
        }

        function AddFundCenter(Id, ActivityTypeCode, PlanYear) {


            TINY.box.show({ iframe: 'AddFundCenterToActivityType.aspx?activityTypeCode=' + ActivityTypeCode + '&planYear=' + PlanYear, boxid: 'frameless', width: 850, height: 470, fixed: false, maskid: 'lightmask', maskopacity: 40, closejs: function () { closeJS() } });

        }
    </script>
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div style="margin-left: 10px; padding: 10px 10px 10px 10px;">
        <div style="width: 100%; float: left; margin-top: 10px;">
            <asp:Label ID="ScreenName" runat="server"></asp:Label>
        </div>
        <div style="text-align: center; float: left; width: 98%; margin-top: 10px; -webkit-border-radius: 5px; padding: 5px 5px 0px 0px;">

            <div style="text-align: left; float: left; width: 80%; border: solid; border-color: gray; border-width: 1px; margin-top: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; box-shadow: 5px 5px 5px #808080; padding: 5px 5px 5px 5px;">

                <table border="0">
                    <tr>
                        <td>&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:Label ID="Label4" runat="server" Text=" รหัสครุภัณฑ์"></asp:Label>
                        </td>
                        <td>&nbsp;&nbsp;&nbsp;&nbsp;   
                            <asp:TextBox ID="CodeTxt" runat="server" Width="100px" Style="text-align: left;" MaxLength="8"></asp:TextBox>
                        </td>
                        <td>&nbsp;&nbsp;&nbsp;&nbsp;    
                <asp:Label ID="Label2" runat="server" Text=" ชื่อครุภัณฑ์"></asp:Label></td>
                        <td>&nbsp;&nbsp;&nbsp;&nbsp;     
                <asp:TextBox ID="SearchTxt" runat="server" Width="210px" Style="text-align: left;"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;    </td>
                        <td>
                            <asp:Label ID="Label3" runat="server" Text="Asset Group"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;  </td>
                        <td>&nbsp;&nbsp;&nbsp;&nbsp;   
                            <iswebcombo:webcombo id="AssetGroupCombo" width="200px" runat="server" usedefaultstyle="True" height="20px" datasourceid="AssetObjectDataSource" datatextfield="Description" datavaluefield="AssetGroup">
                                <LayoutSettings AlwaysShowAllRowsOnDropdown="true" AlwaysShowHelpButton="false">
                                </LayoutSettings>
                            </iswebcombo:webcombo>
                            <asp:ObjectDataSource ID="AssetObjectDataSource" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MasterDataSetTableAdapters.Asset_GroupTableAdapter" InsertMethod="Insert"></asp:ObjectDataSource>
                        </td>
                    </tr>
                </table>
            </div>

            <div style="text-align: center; float: left; width: 15%; height: 28px; border: solid; border-color: gray; border-width: 1px; margin-top: 10px; margin-left: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; box-shadow: 5px 5px 5px #808080; padding: 5px 5px 5px 5px;">
                &nbsp;&nbsp;&nbsp;&nbsp; 
                <asp:Label ID="Label1" runat="server" Text="ปีงบประมาณ"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp; 
                <asp:TextBox ID="PlanYearsTxt" runat="server" Width="40px" Style="text-align: center;" MaxLength="4"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;  

            </div>

        </div>
        <div style="text-align: right; float: left; width: 97%; border: solid; border-color: gray; border-width: 1px; margin-top: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; box-shadow: 5px 5px 5px #808080; padding: 5px 5px 5px 5px;">

            <table id="t_countdata" runat="server" width="300" visible="false" border="0" style="float: left; margin-left: 13px;">
                <tr>
                    <td align="left" style="width: 80px;" valign="middle">
                        <asp:Label ID="L_data" runat="server" Text="ผลการค้นหา: "></asp:Label>
                    </td>
                    <td align="left">
                        <asp:Label ID="L_CountData" runat="server" ForeColor="red"></asp:Label>
                        <asp:Label ID="L_test" runat="server" CssClass="label" Visible="false"></asp:Label>
                        &nbsp;
                    </td>
                </tr>
            </table>
            <table style="float: right;">
                <tr>
                    <td>
                        <asp:ImageButton ID="SearhBtn" runat="server" ImageUrl="Icons/search.jpg" />
                        <asp:ImageButton ID="delete_btn" runat="server" ImageUrl="Icons/delete.jpg" OnClientClick="CustomRequestChkDel(); return false" />
                        &nbsp;<asp:ImageButton ID="SaveBtn" runat="server" ImageUrl="Icons/save.jpg" Style="height: 21px" />
                    </td>
                </tr>
            </table>
        </div>
        <div style="float: left; width: 97%; border: solid; border-color: gray; border-width: 1px; margin-top: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; box-shadow: 5px 5px 5px #808080; padding: 5px 5px 5px 5px;">
            <iswebgrid:webgrid id="WebGrid1" runat="server" usedefaultstyle="True" width="100%" defaultstylemode="Silver" height="390px" onaddrow="WebGrid1_AddRow" onupdaterow="WebGrid1_UpdateRow" oninitializepostback="WebGrid1_InitializePostBack" oninitializerow="WebGrid1_InitializeRow">
                <LayoutSettings AllowAddNew="Yes" EditOnClick="True" AllowColumnMove="No"
                    AllowEdit="Yes" AllowSorting="Yes" ColumnFooters="Yes" NewRowLostFocusAction="AlwaysUpdate"
                    ResetNewRowValuesOnError="False" InProgressUIBehavior="ChangeCursorToHourGlass"
                    AlwaysShowHelpButton="false" PagingMode="ClassicPaging" PagingSize="12" ColumnFooterAggregateMode="CalculateAllData"
                    VirtualLoadMode="LargeData" AllowGrouping="Yes" VirtualPageSize="12" PagingLoadMode="Automatic">
                    <RowStyle Font-Names="Tahoma" Font-Size="9" CustomRules="overflow: hidden;" />
                    <AlternatingRowStyle Font-Names="Tahoma" Font-Size="9" BackColor="#fbfbfb" CustomRules="overflow: hidden;" />
                    <ClientSideEvents OnRowValidate="WebGrid1_OnRowValidate" OnRowContextMenu="WebGrid1_OnRowContextMenu" OnEditKeyDown="WebGrid1_OnEditKeyDown" />
                </LayoutSettings>
                <RootTable DataKeyField="Id" NewRowInfoText="เพิ่มรายการ">
                    <Columns>
                        <ISWebGrid:WebGridColumn IsRowChecker="true" Name="checker">
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="Code" DataMember="ActivityTypeCode" Name="ActivityTypeCode" Width="110" TextboxMaxlength="6">
                            <HeaderStyle HorizontalAlign="Center" />
                            <CellStyle HorizontalAlign="Center" />
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="PlanYear" DataMember="PlanYear" Name="PlanYear" Width="80" TextboxMaxlength="4">
                            <HeaderStyle HorizontalAlign="Center" />
                            <CellStyle HorizontalAlign="Center" />
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="Description" DataMember="Description" Name="Description" Width="220">
                            <HeaderStyle HorizontalAlign="Center" />
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="Price" DataMember="Price" Name="Price" Width="75" DataFormatString="##,##0">
                            <HeaderStyle HorizontalAlign="Center" />
                            <CellStyle HorizontalAlign="right" />
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="Asset Group" Name="AssetGroupCol" DataMember="AssetGroup" Width="125px" EditType="WebComboNET" WebComboID="AssetGroupWebCombo11">
                            <HeaderStyle HorizontalAlign="Center" />
                            <CellStyle HorizontalAlign="Left" />
                            <ValueList DataTextField="Description" DataSourceID="AssetGroupObjectDataSource1"
                                DataValueField="AssetGroup">
                            </ValueList>
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="Commitment Item" Name="Cmmt_CmmtCode" DataMember="CmmtItem_CmmtCode" Width="100px" EditType="WebComboNET" WebComboID="Commitment2WebCombo">
                            <HeaderStyle HorizontalAlign="Center" />
                            <CellStyle HorizontalAlign="Left" />
                            <ValueList DataTextField="Description" DataSourceID="Commitment2ObjectDataSource"
                                DataValueField="CmmtCode">
                            </ValueList>
                        </ISWebGrid:WebGridColumn>
                        
                        <ISWebGrid:WebGridColumn Name="Attachment" Width="80px" Caption="Attachment" ColumnType="CheckBox" DataMember="AttFlag" DataType="System.Boolean">
                            <HeaderStyle HorizontalAlign="Center" />
                            <CellStyle HorizontalAlign="Center" />
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption=" " ColumnType="Template" Name="TemplateName" Width="50px">
                                <CellTemplate>
                                    <a href="#" style="text-decoration: none; border: none;" >
                                        <img src="a0.jpg" height="16px" style="text-decoration: none; border: none;" onclick="popupattach1('<%# Eval("Id")%>','<%# Eval("ActivityTypeCode")%>','<%# Eval("PlanYear")%>');" />
                                    </a>
                                    <a href="#" style="text-decoration: none; border: none;">
                                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("attachments_amount") %>' Font-Bold></asp:Label></a>
                                </CellTemplate>
                            <CellStyle HorizontalAlign="Center"></CellStyle>
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption=" " ColumnType="Template" Name="Action" Width="50">
                            <CellTemplate>
                                <a href="#" style="text-decoration: none; border: none;">
                                    <img src="Icons/ic_deleteRed.png" height="16px"  style="text-decoration: none; border: none;" title="ลบ" onclick="CustomRequestDel('<%# Eval("Id")%>','<%# Eval("ActivityTypeCode")%>','<%# Eval("PlanYear")%>');" />
                                </a>
                            </CellTemplate>
                            <CellStyle HorizontalAlign="Center"></CellStyle>
                        </ISWebGrid:WebGridColumn>
                         <ISWebGrid:WebGridColumn Caption=" " ColumnType="Template" Name="AddFundCenter" Width="50">
                            <CellTemplate>
                                <a href="#" style="text-decoration: none; border: none;">
                                   <img src="Icons/ic_new.png" height="16px" id='Img3' style="text-decoration: none; border: none;" title="ระบุ FundCenter" onclick="AddFundCenter('<%# Eval("Id")%>','<%# Eval("ActivityTypeCode")%>','<%# Eval("PlanYear")%>');" />
                                </a>
                            </CellTemplate>
                            <CellStyle HorizontalAlign="Center"></CellStyle>
                        </ISWebGrid:WebGridColumn>
                    </Columns>
                </RootTable>
                <CustomEditors>
                    <ISWebGrid:WebGridCustomEditor ControlType="DHTMLClientControl" JavascriptFiles="Calculator.js" Name="Calculator" Persistence="DesignerLevel" ScriptFolder="EditorsPack1">
                        <Behavior DropdownButtonImageFile="CalcDD.gif" HasDropdownButton="True" />
                    </ISWebGrid:WebGridCustomEditor>
                    <ISWebGrid:WebGridCustomEditor ControlType="DHTMLClientControl" JavascriptFiles="NumericUpDown.js" Name="NumericUpDown" Persistence="DesignerLevel" ScriptFolder="EditorsPack1">
                        <Behavior HasDropdownButton="True" />
                    </ISWebGrid:WebGridCustomEditor>
                    <ISWebGrid:WebGridCustomEditor JavascriptFiles="RichTextBox.js" Name="RichTextBox" Persistence="DesignerLevel" ScriptFolder="EditorsPack1" ServerControlFullName="Telerik.WebControls.RadEditor">
                        <Behavior BaseEditorType="Custom" DropdownButtonType="Custom" HasDropdownButton="True" />
                    </ISWebGrid:WebGridCustomEditor>
                    <ISWebGrid:WebGridCustomEditor JavascriptFiles="WebInputNET.js" Name="WebInputNET" Persistence="DesignerLevel" ScriptFolder="WebInput" ServerControlFullName="ISNet.WebUI.WebControls.WebInput">
                    </ISWebGrid:WebGridCustomEditor>
                    <ISWebGrid:WebGridCustomEditor ControlType="DHTMLClientControl" JavascriptFiles="SlideBar.js" Name="Slidebar" Persistence="DesignerLevel" ScriptFolder="EditorsPack2">
                        <Behavior DropdownButtonImageFile="SliderDD.gif" HasDropdownButton="True" />
                    </ISWebGrid:WebGridCustomEditor>
                    <ISWebGrid:WebGridCustomEditor ControlType="DHTMLClientControl" JavascriptFiles="HtmlEditor.js" Name="HtmlEditor" Persistence="DesignerLevel" ScriptFolder="EditorsPack2">
                        <Behavior BaseEditorType="Custom" />
                    </ISWebGrid:WebGridCustomEditor>
                    <ISWebGrid:WebGridCustomEditor ControlType="DHTMLClientControl" DependencyFiles="SmartWebResources\S\WebScheduler_Calendar.js\301000" JavascriptFiles="VistaCalendar.js;VistaCalendar.css" Name="VistaCalendar" Persistence="DesignerLevel" ScriptFolder="EditorsPack3">
                        <Behavior DropdownButtonImageFile="VistaCalendar.gif" HasDropdownButton="True" SupportElegantStyles="True" />
                    </ISWebGrid:WebGridCustomEditor>
                    <ISWebGrid:WebGridCustomEditor JavascriptFiles="WebTextEditor.js" Name="WebTextEditor" Persistence="DesignerLevel" ScriptFolder="EditorsPack3" ServerControlFullName="ISNet.WebUI.WebTextEditor.WebTextEditor">
                        <Behavior BaseEditorType="Custom" />
                    </ISWebGrid:WebGridCustomEditor>
                </CustomEditors>
            </iswebgrid:webgrid>
            <iswebcombo:webcombo id="AssetGroupWebCombo11" width="200px" runat="server" usedefaultstyle="True" datatextfield="Description" datavaluefield="AssetGroup" height="20px" datasourceid="AssetGroupObjectDataSource1">
                <LayoutSettings AlwaysShowAllRowsOnDropdown="true" AlwaysShowHelpButton="false">
                </LayoutSettings>
            </iswebcombo:webcombo>
            <ISWebCombo:WebCombo id="Commitment2WebCombo" runat="server" usedefaultstyle="True" datatextfield="Description" datavaluefield="CmmtCode" height="20px" width="300px" oninitializedatasource="CommtItemCombo_InitializeDataSource"  additionalsearchfields="CmmtCode" AllowWildCardSearch="true">
                <LayoutSettings AlwaysShowAllRowsOnDropdown="true" AlwaysShowHelpButton="false" EntryMode="AutoComplete" ComboMode="MultipleColumns">
                </LayoutSettings>
                <Columns>
                    <ISWebCombo:WebComboColumn BaseFieldName="CmmtCode" Name="CmmtCode" HeaderText="รหัส commitment" Width="100px" />
                    <ISWebCombo:WebComboColumn BaseFieldName="Description" Name="Description" HeaderText="ชื่อ commitment" Width="200px" />
                </Columns>
            </ISWebCombo:WebCombo>
        </div>
    </div>
    <br />
    <br />

    <asp:ObjectDataSource ID="AssetGroupObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MasterDataSetTableAdapters.Asset_GroupTableAdapter" InsertMethod="Insert">
        <InsertParameters>
            <asp:Parameter Name="assetGroup" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="Commitment2ObjectDataSource" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataByPlanYear" TypeName="MasterDataSet2TableAdapters.CmmtsTableAdapter">

        <SelectParameters>
            <asp:SessionParameter Name="PlanYear" SessionField="PlanYear" Type="Int16" />
<%--            <asp:ControlParameter ControlID="PlanYearsTxt" Name="PlanYear" PropertyName="Text" Type="Int16" />--%>
        </SelectParameters>

    </asp:ObjectDataSource>


</asp:Content>

